package com.kobe.controller;

import cn.hutool.core.lang.tree.Tree;
import com.kobe.common.core.domain.AjaxResult;
import com.kobe.service.CategoryService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 资产分类树表
 */
@RestController
@RequestMapping("/asset/category")
@RequiredArgsConstructor
public class CategoryController {

    private final CategoryService categoryService;


    /**
     * 查询资产分类树表
     */
    @GetMapping("/list")
    public AjaxResult list() {
        List<Tree<String>> list = categoryService.tree();



        return AjaxResult.success(list);
    }

}
